package main

import "fmt"

func solution(n int, k int) int {
    // PLEASE DO NOT MODIFY THE FUNCTION SIGNATURE
    // write code here
    res := 0
    for i := 1; i < n+1; i++ {
        res = res + k*i
    }

    return res
}

func main() {
    fmt.Println(solution(3, 1) == 6)
    fmt.Println(solution(2, 2) == 6)
    fmt.Println(solution(4, 3) == 30)
}